home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Library / Manuels & Misc / Assembly / AOA.ZIP / SAMPLES / PATTERNS.A < prev   
Encoding:
Text File  |  1993-09-17  |  6.7 KB  |  253 lines

  1. ; Patterns.a-     This file contains all the patterns and strings which the
  2. ;        program uses.  It is included rather than compiled separately
  3. ;        only because these patterns are only used in the main
  4. ;        program.  These patterns appear in a separate file because
  5. ;        they cause too much of a distraction in the main program.
  6. ;
  7. ;
  8. ;
  9. ;
  10. ; The following macro generates a pattern which will match a single word
  11. ; which appears anywhere on a line:
  12.  
  13. MatchWord    macro        Name, WordStr
  14.         local        WS1, WS2, WS3, WS4
  15.  
  16. Name        Pattern        {MatchStr, WordStr, WS2, MatchSpc}
  17. WS2        Pattern        {arb,0,0,WS3}
  18. WS3        Pattern        {Matchchar, ' ',0, WS4}
  19. WS4        Pattern        {MatchStr, WordStr, 0, MatchEOS}
  20.         endm
  21.  
  22.  
  23. ; Generic patterns which most of the patterns use:
  24.  
  25. MatchEOS    Pattern        {EOS,0,MatchSpc,0}
  26. MatchSpc    Pattern        {MatchChar,' '}
  27.  
  28.  
  29. ; Okay, set up the patterns to match GO, NORTH, SOUTH, EAST, WEST:
  30.  
  31. GoStr        byte        "GO",0
  32. NorthStr    byte        "NORTH",0
  33. SouthStr    byte        "SOUTH",0
  34. EastStr        byte        "EAST",0
  35. WestStr        byte        "WEST",0
  36.  
  37.         MatchWord    MatchGO, GoStr
  38.         MatchWord    MatchNorth, NorthStr
  39.         MatchWord    MatchSouth, SouthStr
  40.         MatchWord    MatchEast, EastStr
  41.         MatchWord    MatchWest, WestStr
  42.  
  43. ; Okay, set up the patterns to match GET, DROP, LIME, BEER, CARD, SIGN,
  44. ; PROGRAM, HOMEWORK, MONEY, FORM, and COUPON.
  45.  
  46. GetStr        byte        "GET",0
  47. DropStr        byte        "DROP",0
  48. LimeStr        byte        "LIME",0
  49. BeerStr        byte        "BEER",0
  50. CardStr        byte        "CARD",0
  51. SignStr        byte        "SIGN",0
  52. PgmStr        byte        "PROGRAM",0
  53. HWStr        byte        "HOMEWORK",0
  54. MoneyStr    byte        "MONEY",0
  55. FormStr        byte        "FORM",0
  56. CouponStr    byte        "COUPON",0
  57.  
  58.         MatchWord    MatchGet, GetStr
  59.         MatchWord    MatchDrop, DropStr
  60.         MatchWord    MatchLime, LimeStr
  61.         MatchWord    MatchBeer, BeerStr
  62.         MatchWord    MatchCard, CardStr
  63.         MatchWord    MatchSign, SignStr
  64.         MatchWord    MatchPgm,  PgmStr
  65.         MatchWord    MatchHW,   HWStr
  66.         MatchWord    MatchMoney, MoneyStr
  67.         MatchWord    MatchForm,  FormStr
  68.         MatchWord    MatchCoupon, CouponStr
  69.  
  70. ; Okay, set up the patterns for INVENTORY, QUIT, and HELP here:
  71.  
  72. InventoryStr    byte        "INVENTORY",0
  73. QuitStr        byte        "QUIT",0
  74. HelpStr        byte        "HELP",0
  75.  
  76.         MatchWord    MatchInv, InventoryStr
  77.         MatchWord    MatchQuit, QuitStr
  78.         MatchWord    MatchHelp, HelpStr
  79.  
  80.  
  81.  
  82.  
  83.  
  84. ; Data structures for the "maze":
  85.  
  86. Room1        room        {Room1, Room5, Room4, Room2,
  87.                  {Item1,0,0,0},
  88.                  Room1Desc}
  89.  
  90. Room1Desc    byte        "at the Commons",0
  91.  
  92. Item1        item        {10,2,Room3,GS1,GS2,GS3}
  93. GS1        byte        "a big sign",0
  94. GS2        byte        "a big sign made of styrofoam with funny "
  95.         byte        "letters on it.",0
  96. GS3        byte        "The ETA PI Fraternity thanks you for return"
  97.         byte        "ing their sign, they",cr,lf
  98.         byte        "make you an honorary life member, as long as "
  99.         byte        "you continue to pay",cr,lf
  100.         byte        "your $300 monthly dues, that is.",0
  101.  
  102.  
  103.  
  104.  
  105. Room2        room        {NULL, Room5, Room1, Room3,
  106.                  {Item2,0,0,0},
  107.                  Room2Desc}
  108.  
  109. Room2Desc    byte        'at the "C"',0
  110.  
  111. Item2        item        {10,1,Room1,LC1,LC2,LC3}
  112. LC1        byte        "a lunch card",0
  113. LC2        byte        "a lunch card which someone must have "
  114.         byte        "accidentally dropped here."
  115. LC3        byte        "You get a big meal at the Commons cafeteria"
  116.         byte        cr,lf
  117.         byte        "It would be a good idea to go visit the "
  118.         byte        "student health center",cr,lf
  119.         byte        "at this time.",0
  120.  
  121.  
  122.  
  123.  
  124. Room3        room        {NULL, Room6, Room2, Room2,
  125.                  {Item3,0,0,0},
  126.                  Room3Desc}
  127.  
  128. Room3Desc    byte        "at ETA PI Frat House",0
  129.  
  130. Item3        item        {10,2,Room2,BL1,BL2,BL3}
  131. BL1        byte        "a bag of lime",0
  132. BL2        byte        "a bag of baseball field lime which someone "
  133.         byte        "is obviously saving for",cr,lf
  134.         byte        "   a special occasion.",0
  135. BL3        byte        "You spread the lime out forming a big '++' "
  136.         byte        "after the 'C'",cr,lf
  137.         byte        "Your friends in Computer Science hold you "
  138.         byte        "in total awe.",0
  139.  
  140.  
  141.  
  142.  
  143. Room4        room        {Room1, Room7, Room7, Room5,
  144.                  {Item4,0,0,0},
  145.                  Room4Desc}
  146.  
  147. Room4Desc    byte        "in Tom Payne's Office",0
  148.  
  149. Item4        item        {10,1,Room7,HW1,HW2,HW3}
  150. HW1        byte        "a homework assignment",0
  151. HW2        byte        "a homework assignment which appears to "
  152.         byte        "to contain assembly language",0
  153. HW3        byte        "The CS 13 reader notes that your homework "
  154.         byte        "assignment looks quite",cr,lf
  155.         byte        "similar to someone else's assignment in the "
  156.         byte        "class and reports you",cr,lf
  157.         byte        "to the instructor.",0
  158.  
  159.  
  160.  
  161.  
  162. Room5        room        {Room1, Room9, Room7, Room2,
  163.                  {Item5,0,0,0},
  164.                  Room5Desc}
  165.  
  166. Room5Desc    byte         "in the CSLD",0
  167.  
  168. Item5        item        {10,1,Room9,M1,M2,M3}
  169. M1        byte        "some money",0
  170. M2        byte        "several dollars in an envelop in the "
  171.         byte        "trashcan",0
  172. M3        byte        "The waitress thanks you for your generous "
  173.         byte        "tip and gets you",cr,lf
  174.         byte        "another pitcher of beer.  Then she asks for "
  175.         byte        "your ID.",cr,lf
  176.         byte        "You are at least 21 aren't you?",0
  177.  
  178.  
  179.  
  180.  
  181.  
  182. Room6        room        {Room3, Room9, Room5, NULL,
  183.                  {Item6,0,0,0},
  184.                  Room6Desc}
  185.  
  186. Room6Desc    byte         "at the book store",0
  187.  
  188. Item6        item        {10,1,Room8,AD1,AD2,AD3}
  189. AD1        byte        "an add/drop/change form",0
  190. AD2        byte        "an add/drop/change form filled out for "
  191.         byte        "CS 13 to get a letter grade",0
  192. AD3        byte        "You got the form in just in time.  It would "
  193.         byte        "have been a shame to",cr,lf
  194.         byte        "have had to retake CS 13 because you didn't "
  195.         byte        "realize you needed to ",cr,lf
  196.         byte        "get a letter grade in the course.",0
  197.  
  198.  
  199.  
  200. Room7        room        {Room1, Room7, Room4, Room8,
  201.                  {Item7,0,0,0},
  202.                  Room7Desc}
  203.  
  204. Room7Desc    byte         "in the CS 13 lecture",0
  205.  
  206. Item7        item        {10,1,Room5,AP1,AP2,AP3}
  207. AP1        byte        "an assembly language program",0
  208. AP2        byte        "an assembly language program due in CS13",0
  209. AP3        byte        "The sample program the instructor gave you "
  210.         byte        "provided all the information",cr,lf
  211.         byte        "you needed to complete your assignment.  You "
  212.         byte        "finish your work and",cr,lf
  213.         byte        "head to the Bull & Mouth to celebrate."
  214.         byte        cr,lf,0
  215.  
  216.  
  217.  
  218.  
  219. Room8        room        {Room5, Room6, Room7, Room9,
  220.                  {Item8,0,0,0},
  221.                  Room8Desc}
  222.  
  223. Room8Desc    byte         "at the Registrar's office",0
  224.  
  225. Item8        item        {10,1,Room6,C1,C2,C3}
  226. C1        byte        "a coupon",0
  227. C2        byte        "a coupon good for a free text book",0
  228. C3        byte        'You get a free copy of "Cliff Notes for '
  229.         byte        'The Art of Assembly',cr,lf
  230.         byte        'Language Programming"  Alas, it does not '
  231.         byte        "provide all the",cr,lf
  232.         byte        "information you need for the class, so you "
  233.         byte        "sell it back during",cr,lf
  234.         byte        "the book buy-back period.",0
  235.  
  236.  
  237.  
  238. Room9        room        {Room6, Room9, Room8, Room3,
  239.                  {Item9,0,0,0},
  240.                  Room9Desc}
  241.  
  242. Room9Desc    byte         "at The Barn",0
  243. Item9        item        {10,2,Room4,B1,B2,B3}
  244. B1        byte        "a pitcher of beer",0
  245. B2        byte        "an ice cold pitcher of imported beer",0
  246. B3        byte        "Dr. Payne thanks you profusely for your "
  247.         byte        "good taste in brews.",cr,lf
  248.         byte        "He then invites you to the Barn for a good "
  249.         byte        "round of pool and",cr,lf
  250.         byte        "some heavy duty hob-nobbing, CS Department "
  251.         byte        "style.",0
  252.  
  253.